<html>
<head><meta charset="utf-8"><title>How does BoxFuture work? · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html">How does BoxFuture work?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217167021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How%20does%20BoxFuture%20work%3F/near/217167021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html#217167021">(Nov 18 2020 at 17:17)</a>:</h4>
<p><a href="https://doc.rust-lang.org/src/alloc/boxed.rs.html#1162-1168">https://doc.rust-lang.org/src/alloc/boxed.rs.html#1162-1168</a></p>
<p>this impl require T: Unpin</p>
<p>but here I show a non-Unpin future being boxed: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=e7f87d7200606f133c2013afd1a351b3">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=e7f87d7200606f133c2013afd1a351b3</a> and I can await it....</p>



<a name="217167223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How%20does%20BoxFuture%20work%3F/near/217167223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html#217167223">(Nov 18 2020 at 17:18)</a>:</h4>
<p>oh no how do I move this to general, i messed up zulip</p>



<a name="217167539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How%20does%20BoxFuture%20work%3F/near/217167539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html#217167539">(Nov 18 2020 at 17:20)</a>:</h4>
<p>oh jeez only mods and admins can do it, this is embarrassing</p>



<a name="217167687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How%20does%20BoxFuture%20work%3F/near/217167687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html#217167687">(Nov 18 2020 at 17:21)</a>:</h4>
<p><code>BoxFuture</code> is a <code>Pin&lt;Box&lt;dyn Future&gt;&gt;</code> not a <code>Box&lt;dyn Future&gt;</code>.</p>



<a name="217168071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How%20does%20BoxFuture%20work%3F/near/217168071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/How.20does.20BoxFuture.20work.3F.html#217168071">(Nov 18 2020 at 17:24)</a>:</h4>
<p>ah i see i misunderstood the bounds here: <a href="https://doc.rust-lang.org/beta/core/pin/struct.Pin.html#impl-Future">https://doc.rust-lang.org/beta/core/pin/struct.Pin.html#impl-Future</a> this is just requiring : Future on what Box derefmut's into, and box is always unpin</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>